package com.xinqi.modules.sys.gpt.controller.inner;

import com.xinqi.common.base.response.R;
import com.xinqi.modules.sys.gpt.service.ChatMessageService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/inner/chatMessage")
@RequiredArgsConstructor
public class ChatMessageInnerController {

    private final ChatMessageService chatMessageService;

    /**
     * 请求失败-- 回调 -- 恢复一次配额
     *
     * @param userId
     */
    @GetMapping("/recoveryByUser")
    public R<Boolean> recoveryByUser(Long userId) {
        chatMessageService.recoveryByUser(userId);
        return R.ok();
    }

    /**
     * 请求失败-- 回调 -- 回复包含敏感内容
     * @param mesageId
     */
    @GetMapping("/attributeMessage")
    public R<Boolean> attributeMessage(String mesageId) {
        chatMessageService.attributeMessage(mesageId);
        return R.ok();
    }

}
